<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // symbol基础语法
        let a = Symbol('标识符')
        console.log(a);

        let b = Symbol('age');
        let c = Symbol('age');
        console.log(b===c);
        console.log(b==c);

        //模拟生成以一个独一无二的值
        function Symbol(){
            return Date.now()*Math.random();
        }
        let ms1 = Symbol('age');
        let ms2 = Symbol('age');
        let ms4 = Symbol();
        let ms5 = Symbol();

        console.log(ms1);
        console.log(ms2 == ms1);
        console.log(ms2 === ms1);
        console.log(ms4);
        console.log(ms5 == ms4);
        console.log(ms5 === ms4);
    </script>   
</body>
</html>